// const test = 'http://localhost:8080/api/v1/nav'

const install = (Vue, vm) => {
	const creatPostApi = (path) => {
		return (params = {}) => vm.$u.http.post(path, params)
	}
	const creatGetApi = (path) => {
		return (params = {}) => vm.$u.http.get(path, params)
	}

	const getStoreInfo = creatGetApi('/store/getInformation'); //获取商家信息 {storeId:1}
	
	const updateStoreInfo = creatPostApi('/store/update'); //修改商家信息 {storeId:1}
	
	const updateStoreBgInfo = creatPostApi('/store/updateInformation'); //修改商家背景图和最新情报 {storeId:1}
	
	const getSystemPicture = creatPostApi('/carousel/getSystemPicture'); //可选背景图
	
	const getStoreCarousel = creatGetApi('/store/getStoreCarousel'); //获取商家轮播 {storeId:1}
	
	const addStoreCarousel = creatPostApi('/store/addStoreCarousel'); //添加商家轮播 {storeId:1}
	
	const deleteStoreCarousel = creatPostApi('/store/deleteStoreCarousel'); //删除商家轮播 {storeId:1}
	
	const getStorePresentList = creatGetApi('/store/presentList'); //获取商家主持人列表 {storeId:1}
	
	const getPresent = creatPostApi('/store/getPresent'); //获取主持人信息 {presentId:1}
	
	const addPresent = creatPostApi('/store/addPresent'); //添加主持人 
	
	const editPresent = creatPostApi('/store/updatePresent'); //编辑主持人 
	
	const delPresent = creatPostApi('/store/deletePresent'); //删除主持人 {presentId}
	
	const addPresentPlay = creatPostApi('/store/addPresentPlay'); //添加主持人会开剧本 {presentId,playId}
	
	const getPresentPlay = creatPostApi('/store/getPresentPlay'); //查询主持人会开剧本 {presentId,page,number}
	
	const deletePresentPlay = creatPostApi('/store/deletePresentPlay'); //删除主持人会开剧本 {presentId,playId}

	const getStoreList = creatPostApi('/store/list'); //商家获取总台的剧本列表 select 不传或者为空是查询总台剧本，1是商家已添加的剧本

	const addPlay = creatPostApi('/store/addplay');//{playId:142,storeId:9,price:99.00} //商家添加剧本
	
	const updateplay = creatPostApi('/store/updateplay');//{playId:142,storeId:9,price:99.00} //商家修改剧本价格
	
	const deletestorePlay = creatPostApi('/store/deletestoreplay');//{playId:142,storeId:9} //商家删除剧本
	
	const getOrder = creatPostApi('/store/getOrder'); //拼车列表 {storeId:9,select:3,page:1,number:5}
	
	const getRoomList = creatPostApi('/store/roomlist'); //房间列表 {storeId:9}
	
	const addRoom = creatPostApi('/store/addroom'); //添加房间 {storeId:9}
	
	const delRoom = creatPostApi('/store/deleteroom'); //删除房间 {roomId:9}
	
	const updateRoom = creatPostApi('/store/updateRoom'); //修改房间 {roomId:9}
	
	const getRoom = creatPostApi('/store/getRoom'); //查询房间 {roomId:9}
	
	const getWriteInfo = creatPostApi('/store/heXiao'); //获取核销前信息 {verification=20210825170359311&storeId=9}
	
	const updateWrite = creatPostApi('/store/heXiaoStatus'); //核销用户订单 {verification=20210825170359311}
	
	const FundRecord = creatPostApi('/order/income'); //商家收入记录和提现记录 {storeId&page&number&select}
	
	const MerchantWithdrawal = creatPostApi('/store/withdrawal'); //商家申请提现 {storeId&money}
	
	const getBank = creatPostApi('/store/getBank'); //查询银行卡信息 {storeId}
	
	const addBank = creatPostApi('/store/addBank'); //修改银行卡信息 {storeId}
	
	const getStoreTelephone = creatPostApi('/store/getStoreTelephone'); //获取店铺手机号 {storeId}
	
	const CreateFleet = creatPostApi('/store/car'); //商家创建车队 {}
	
	const temporaryCar = creatPostApi('/store/temporaryCar'); //商家发布临时车位  √
	
	const delSystemUser = creatPostApi('/store/deleteSystemUser'); //商家删除用户到车队 {orderId=241&userId=19}
	
	const addUserToCar = creatPostApi('/store/addUser'); //商家添加用户到车队    √
	
	const sms = creatPostApi('/store/sms'); //发送验证码 {number,select:0 修改银行卡，1申请成为商家}
	
	const getExit = creatPostApi('/store/getExit'); //商家查询用户申请退款的订单 {}
	
	const shenhe = creatPostApi('/store/shenhe'); //商家审核退款订单 {}
	
	vm.$u.adminApi = { //暴露出去方法
		//商家信息
		getStoreInfo,
		updateStoreInfo,
		updateStoreBgInfo,
		getSystemPicture,
		
		//轮播图
		getStoreCarousel,
		addStoreCarousel,
		deleteStoreCarousel,
		
		//主持人
		getStorePresentList,
		getPresent,
		addPresent,
		editPresent,
		delPresent,
		addPresentPlay,
		getPresentPlay,
		deletePresentPlay,
		
		//剧本
		getStoreList,
		addPlay,
		updateplay,
		deletestorePlay,
		
		//拼车
		getOrder,
		
		//房间
		getRoomList,
		addRoom,
		delRoom,
		updateRoom,
		getRoom,
		
		//核销
		getWriteInfo,
		updateWrite,
		
		//资金
		FundRecord,
		MerchantWithdrawal,
		getBank,
		addBank,
		getStoreTelephone,
		
		//创建车队
		CreateFleet,
		delSystemUser,
		addUserToCar,
		
		// 开通临时车位
		temporaryCar,
		
		//验证码
		sms,
		
		//退款管理
		getExit,
		shenhe,
	}
}

export default {
	install
}
